package br.edu.fa7.quotes.ui;

import android.app.Activity;
import android.app.NotificationManager;
import android.content.Context;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import br.edu.fa7.quotes.R;
import br.edu.fa7.quotes.model.Quote;
import br.edu.fa7.quotes.model.QuoteDB;

public class Notificacao extends Activity {

	private QuoteDB quoteDB;
	private Quote quote;
	private TextView txt;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		final NotificationManager nm = (NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE);
		nm.cancel(R.string.app_name);

		quoteDB = new QuoteDB(this);
		quote = quoteDB.todaysQuote();

		setContentView(R.layout.activity_quote);
		txt = (TextView) findViewById(R.id.txtQuote);
		txt.setText(quote.getQuote());
	}

	public void btnOkClick(View v) {
		finish();
	}
}
